{
  "openapi": "3.0.1",
  "info": {
    "title": "Nullable Refs Example",
    "version": "1.0.0"
  },
  "components": {
    "schemas": {
      "myObject": {
        "type": "object",
        "nullable": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "TestObject": {
        "type": "object",
        "properties": {
          "stringMaybeUndefined": {
            "type": "string"
          },
          "stringMaybeNullA": {
            "type": "string",
            "nullable": true
          },
          "stringMaybeNullB": {
            "anyOf": [
              {
                "type": "string"
              }
            ],
            "nullable": true
          },
          "stringMaybeNullAndUndefined": {
            "anyOf": [
              {
                "type": "string"
              }
            ],
            "nullable": true
          },
          "otherObjectMaybeUndefined": {
            "$ref": "#/components/schemas/OtherObject"
          },
          "otherObjectMaybeNullA": {
            "$ref": "#/components/schemas/OtherObject",
            "nullable": true
          },
          "otherObjectMaybeNullB": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OtherObject"
              }
            ],
            "nullable": true
          },
          "otherObjectMaybeNullC": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OtherObject"
              }
            ],
            "type": "null"
          },
          "otherObjectMaybeNullD": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OtherObject"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "stringMaybeNullA",
          "stringMaybeNullB",
          "otherObjectMaybeNullA",
          "otherObjectMaybeNullB",
          "otherObjectMaybeNullC",
          "otherObjectMaybeNullD"
        ]
      },
      "OtherObject": {
        "type": "object"
      }
    }
  }
}